<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bookshop</title>

    <!-- Bootstrap -->
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="/assets/css/animate.min.css" rel="stylesheet">
    <link href="/assets/css/main.min.css" rel="stylesheet">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/assets/images/favicon.ico">

    <link href='http://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic' rel='stylesheet'
          type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Fira+Sans:400,300,300italic,400italic,500,500italic,700,700italic'
          rel='stylesheet' type='text/css'>
</head>

<body>


<div id="wrapper">
    <div id="page-content-wrapper" class="st-pusher">
        <div class="st-pusher-after"></div>
        <!-- ============================================== HEADER ============================================== -->

        <jsp:include page="header.jsp"/>


        <!-- ============================================== HEADER : END ============================================== -->
        <div class="footer-content">
            <div class="contact-form-container">
                <div id="map">
                    <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3886.0080692193333!2d80.29172300000002!3d13.098675000000002!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a526f446a1c3187%3A0x298011b0b0d14d47!2sTransvelo!5e0!3m2!1sen!2sin!4v1415189477065"></iframe>
                </div>
                <div class="container">
                    <ul class="breadcrumb text-center">
                        <li class="active">我的基本信息</li>
                    </ul><!-- /.breadcrumb -->
                    <div class="row inner-top-md">
                        <div class="col-md-10 center-block">
                            <div class="contact-block">
                                <div class="contact-form-envelope">
                                    <div class="contact-box">
                                        <div class="row">
                                            <div class="col-md-8 col-sm-8">
                                                <div class="contact-form">
                                                    <form id="loginForm" class="form-horizontal contact-form">
                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >学号：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.stuNum}" type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->

                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >姓名：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.userName}"  type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->

                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >学制：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.educationName}"  type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->

                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >专业：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.majorName}"type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->

                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >联系方式：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.phone}"  type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->

                                                        <div class="form-group">
                                                            <label class="control-label col-sm-3 info-title" >家庭住址：</label>
                                                            <div class="col-sm-9">
                                                                <input  disabled="disabled" class="form-control bookshop-form-control" value="${userVo.homeAddress}"  type="text" name="stuNum">
                                                            </div><!-- /.col -->
                                                        </div><!-- /.form-group -->


                                                    </form>
                                                </div><!-- /.contact-form -->
                                            </div><!-- /.col -->



                                            <c:if test="${sessionScope.current_user eq null}" >
                                                <div class="col-md-4 col-sm-4">
                                                    <section class="contact-detail">
                                                        <div class="head-office-address">
                                                            <h4 class="title">请先登录</h4>
                                                        </div>
                                                    </section>
                                                </div><!-- /.col -->
                                            </c:if >
                                            <c:if test="${sessionScope.current_user != null}">
                                                <div class="col-md-4 col-sm-4">
                                                    <section class="contact-detail">
                                                        <div class="head-office-address">
                                                            <h4 class="title">需要领取的教材</h4>
                                                            <c:forEach items="${list}" var="receiver">
                                                                <p>${receiver}</p>
                                                            </c:forEach>


                                                        </div>
                                                        <hr>
                                                        <div class="branch-office-address">
                                                            <h4 class="title">我的领书码</h4>
                                                            <c:if test="${receiver  == null}">
                                                                <span>您还没有预约领取教材！</span>
                                                                <a style="cursor: pointer;" onclick="submitBook()">马上预约</a>
                                                            </c:if>

                                                            <c:if test="${ null != receiver}">
                                                                <span>您的预约码为：</span>
                                                                <span>${receiver.code}</span>
                                                            </c:if>

                                                        </div>
                                                        <hr>
                                                        <div class="social-connection">
                                                            <h4 class="title">友情连接
                                                            </h4>
                                                            <ul class="social-connection-list list-inline">
                                                                <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-pinterest"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-linkedin"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-google-plus"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-rss"></i></a></li>
                                                                <li><a href="#"><i class="fa fa-instagram"></i></a></li>
                                                            </ul>
                                                        </div>
                                                    </section>
                                                </div><!-- /.col -->
                                            </c:if>

                                        </div><!-- /.row -->
                                    </div><!-- /.contact-box -->
                                </div><!-- /.contact-form-envelope -->
                            </div>
                        </div>
                    </div><!-- /.row -->
                </div><!-- /.container -->
            </div><!-- /.contact-form-container -->
        </div><!-- /.content -->
        <!-- ============================================== FOOTER ============================================== -->
        <footer class="footer clearfix">
            <div class="margin-top-10">
                <div class="container inner-top-vs">
                    <!-- ============================================== FOOTER-TOP ============================================== -->
                    <div class="row">
                        <div class="col-md-3 col-sm-4">
                            <div class="footer-module">
                                <h4 class="footer-module-title">关于本网站</h4>
                                <div class="footer-module-body m-t-20 clearfix">
                                    <p><span class="pull-left"><img src="/assets/images/footer-logo.png" alt=""
                                                                    width="75" height="75"></span>一个cras
                                        tincidunt，ut tellus etGravida
                                        scele risque，ipsum sed iacul is，nunc non namtellus。Placerat sed phasellus，purus purus
                                        elit。Cras ante eros。Erat vel。Donec vestibulum sed，vel euismod
                                        donec。</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-4">
                            <div class="footer-module">
                                <h4 class="footer-module-title">分类</h4>
                                <div class="footer-module-body clearfix">
                                    <ul class="list-unstyled link-list">
                                        <li><a href="#">图书</a></li>
                                        <li><a href="#">课本</a></li>
                                        <li><a href="#">Nook书籍</a></li>
                                        <li><a href="#">有声读物</a></li>
                                        <li><a href="#">杂志</a></li>
                                    </ul>

                                    <ul class="list-unstyled link-list">
                                        <li><a href="#">电影</a></li>
                                        <li><a href="#">音乐</a></li>
                                        <li><a href="#">游戏</a></li>

                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-4 clearfix ">
                            <div class="footer-module">
                                <h4 class="footer-module-title">信息</h4>
                                <div class="footer-module-body clearfix">
                                    <ul class="list-unstyled link-list">
                                        <li><a href="#">跟踪订单</a></li>
                                        <li><a href="#">交货</a></li>
                                        <li><a href="#">退货政策</a></li>
                                        <li><a href="#">礼品卡</a></li>
                                    </ul>

                                    <ul class="list-unstyled link-list">
                                        <li><a href="#">联系我们</a></li>
                                        <li><a href="#">商店位置</a></li>
                                        <li><a href="#">常问问题</a></li>
                                        <li><a href="#">使用条款</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-12">
                            <div class="footer-module">
                                <h4 class="footer-module-title">连</h4>
                                <div class="footer-module-body clearfix">
                                    <ul class="clearfix list-unstyled footer-social-contact">
                                        <li><a href="#" class="fa fa-facebook" title="Facebook的"></a></li>
                                        <li><a href="#" class="fa fa-pinterest" title="Pinterest的"></a></li>
                                        <li><a href="#" class="fa fa-linkedin" title="LinkedIn"></a></li>
                                        <li><a href="#" class="fa fa-twitter" title="推特"></a></li>
                                        <li><a href="#" class="fa fa-google-plus" title="Google Plus"></a></li>
                                        <li><a href="#" class="fa fa-rss" title="RSS"></a></li>
                                        <li><a href="#" class="fa fa-instagram" title="Instagram的"></a></li>
                                    </ul>

                                    <div class="inner-top-xs">
                                        <p>订阅我们的每周时事通讯。</p>
                                        <form class="searchform" action="http://inspectelement.com/" method="get">
                                            <input class="s" type="text" placeholder="Email Address" name="s" value="">
                                           <input class="searchsubmit" type="submit" value="订阅">
                                        </form>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- ============================================== FOOTER-TOP : END ============================================== -->
                    <hr>
                    <!-- ============================================== FOOTER-BOTTOM ============================================== -->
                    <div class="row">
                        <div class="col-md-12">
                            <div class="pull-left">
                                <ul class="payment-list list-unstyled">
                                    <li><a href="#"><img src="/assets/images/payments/1.png" class="img-responsive"
                                                         height="22" alt=""></a></li>

                                </ul>
                            </div>
                            <p class="copyright-footer pull-right">©2014 Bookshop。版权所有。由<a
                                    href="#">Heztheme</a>用爱制造<a href="#"></a></p>
                        </div>
                    </div>
                    <!-- ============================================== FOOTER-BOTTOM : END ============================================== -->
                </div>
            </div>
        </footer>
        <!-- ============================================== FOOTER : END ============================================== -->
    </div><!-- /.st-pusher -->

    <!-- ============================================== TOGGLE RIGHT CONTENT ============================================== -->

    <jsp:include page="content.jsp"/>

    <!-- ============================================== TOGGLE RIGHT CONTENT : END ============================================== -->



</div><!-- /#wrapper -->

<script src="/assets/js/jquery-1.11.2.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/assets/js/bootstrap-hover-dropdown.min.js"></script>
<script src="/assets/js/owl.carousel.min.js"></script>
<script src="/assets/js/perfect-scrollbar.min.js"></script>
<script src="/assets/js/jquery-ui.min.js"></script>
<script src="/assets/js/jquery.customSelect.min.js"></script>
<script src="/assets/js/jquery.easing-1.3.min.js"></script>
<script src="/assets/js/wow.min.js"></script>
<script src="/assets/js/echo.min.js"></script>
<script src="/assets/js/scripts.js"></script>
<div id="goog-gt-tt" class="skiptranslate" dir="ltr">
    <div style="padding: 8px;">
        <div>
            <div class="logo"><img src="https://www.gstatic.com/images/branding/product/1x/translate_24dp.png"
                                   width="20" height="20" alt="Google 翻译"></div>
        </div>
    </div>
    <div class="top" style="padding: 8px; float: left; width: 100%;"><h1 class="title gray">原文</h1></div>
    <div class="middle" style="padding: 8px;">
        <div class="original-text"></div>
    </div>
    <div class="bottom" style="padding: 8px;">
        <div class="activity-links"><span class="activity-link">提供更好的翻译建议</span><span class="activity-link"></span>
        </div>
        <div class="started-activity-container">
            <hr style="color: #CCC; background-color: #CCC; height: 1px; border: none;">
            <div class="activity-root"></div>
        </div>
    </div>
    <div class="status-message" style="display: none;"></div>
</div>


<div class="goog-te-spinner-pos">
    <div class="goog-te-spinner-animation">
        <svg xmlns="http://www.w3.org/2000/svg" class="goog-te-spinner" width="96px" height="96px" viewBox="0 0 66 66">
            <circle class="goog-te-spinner-path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33"
                    r="30"></circle>
        </svg>
    </div>
</div>
</body>

</html>
<script type="text/javascript">

    function submitBook() {
        $.ajax({
            url:'/receiver/book',
            type:'GET',
            dataType:'JSON',
            success:function (result) {
                if (result.code == 200) {
                    alert("预约成功，请前往163查看预约码，或者刷新本页面");
                    window.location.reload();
                } else {
                    alert(result.msg);
                    return;
                }
            }
        })
    }

    $("#myBook").on('click', '#backBook', function () {
        var bookId = $(this).prevAll("#backBookId").val();
        if (!confirm("确定归还该图书吗？")) {
            return false;
        }
        $.ajax({
            url:'/borrow/backBook?bookId=' + bookId,
            dataType:'JSON',
            type:'GET',
            success:function (result) {
                if (result.code == 200) {
                    alert(result.msg);
                    window.location.reload();
                } else {
                    alert(result.msg)
                    return;
                }
            }
        })
    });

</script>
